﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.Weather
{
    /// <summary>
    /// 高德天气实体
    /// </summary>
    [Table("gaodeweathermodels")]
    public class GaoDeWeatherModel : AuditEntity
    {
        /// <summary>
        /// 状态码（0:失败, 1:成功）
        /// </summary>
        public string Status { get; set; }

        /// <summary>
        /// 返回结果总数目
        /// </summary>
        public string Count { get; set; }

        /// <summary>
        /// 返回的状态信息
        /// </summary>
        public string Info { get; set; }

        /// <summary>
        /// 返回状态说明（10000代表正确）
        /// </summary>
        public string Infocode { get; set; }

        /// <summary>
        /// 实况天气数据信息（当extensions=base时）
        /// </summary>
        public List<GaoDeWeatherLive> Lives { get; set; } = new List<GaoDeWeatherLive>();

        /// <summary>
        /// 预报天气信息数据（当extensions=all时）
        /// </summary>
        public GaoDeWeatherForecast Forecast { get; set; }

        /// <summary>
        /// 数据来源
        /// </summary>
        public string DataSource { get; set; } = "高德天气";
    }

    /// <summary>
    /// 高德天气实况数据
    /// </summary>
    public class GaoDeWeatherLive
    {
        /// <summary>
        /// 省份名
        /// </summary>
        public string Province { get; set; }

        /// <summary>
        /// 城市名
        /// </summary>
        public string City { get; set; }

        /// <summary>
        /// 区域编码
        /// </summary>
        public string Adcode { get; set; }

        /// <summary>
        /// 天气现象（汉字描述）
        /// </summary>
        public string Weather { get; set; }

        /// <summary>
        /// 实时气温，单位：摄氏度
        /// </summary>
        public string Temperature { get; set; }

        /// <summary>
        /// 风向描述
        /// </summary>
        public string WindDirection { get; set; }

        /// <summary>
        /// 风力级别，单位：级
        /// </summary>
        public string WindPower { get; set; }

        /// <summary>
        /// 空气湿度
        /// </summary>
        public string Humidity { get; set; }

        /// <summary>
        /// 数据发布的时间
        /// </summary>
        public string ReportTime { get; set; }
    }

    /// <summary>
    /// 高德天气预报数据
    /// </summary>
    public class GaoDeWeatherForecast
    {
        /// <summary>
        /// 城市名称
        /// </summary>
        public string City { get; set; }

        /// <summary>
        /// 城市编码
        /// </summary>
        public string Adcode { get; set; }

        /// <summary>
        /// 省份名称
        /// </summary>
        public string Province { get; set; }

        /// <summary>
        /// 预报发布时间
        /// </summary>
        public string ReportTime { get; set; }

        /// <summary>
        /// 预报数据列表
        /// </summary>
        public List<GaoDeWeatherCast> Casts { get; set; } = new List<GaoDeWeatherCast>();
    }

    /// <summary>
    /// 高德天气预报单日数据
    /// </summary>
    public class GaoDeWeatherCast
    {
        /// <summary>
        /// 日期
        /// </summary>
        public string Date { get; set; }

        /// <summary>
        /// 星期几
        /// </summary>
        public string Week { get; set; }

        /// <summary>
        /// 白天天气现象
        /// </summary>
        public string DayWeather { get; set; }

        /// <summary>
        /// 晚上天气现象
        /// </summary>
        public string NightWeather { get; set; }

        /// <summary>
        /// 白天温度
        /// </summary>
        public string DayTemp { get; set; }

        /// <summary>
        /// 晚上温度
        /// </summary>
        public string NightTemp { get; set; }

        /// <summary>
        /// 白天风向
        /// </summary>
        public string DayWind { get; set; }

        /// <summary>
        /// 晚上风向
        /// </summary>
        public string NightWind { get; set; }

        /// <summary>
        /// 白天风力
        /// </summary>
        public string DayPower { get; set; }

        /// <summary>
        /// 晚上风力
        /// </summary>
        public string NightPower { get; set; }
    }
}
